import unittest
from HwTestReport import HTMLTestReport

if __name__ == '__main__':
    # 读取testcase中的所有test_开头的py文件,
    suite = unittest.defaultTestLoader.discover("testcase", "test_*.py")
    # 创建一个用例执行器--生成网页报告
    file = open("index1.html", "wb")
    runner = HTMLTestReport(
        stream=file,
        title="报告标题",
        description="报告描述",
        tester="测试人",
        images=False
    )

    runner.run(suite)
